﻿// JScript 文件
//添加Application
var rowcountApp=1;     //行号与列号
var peoplenum=1;
var totleincome=0;
var totalIncomePro=0;



//刷新数据：
$(document).ready(function(){
       peoplenum=getPeopleNum();
       totalIncomePro=getPeopleIsproTotalIncoming();
       Totleincome('txbincome','text_val','ckbispro');
}); 


function RefreshAll()
{
        document.getElementById("txbtotleincome").value=getPeopleIsproTotalIncoming();
		document.getElementById("txbpeoplenumIsPro").value=getPeopleIsproNum();
		document.getElementById("txbpeoplenum").value=getPeopleNum();
}


//得到保障家庭数
function getPeopleIsproNum()
{
	obj=document.getElementById("application");
	var arr=obj.getElementsByTagName("input");
	var count=0;
	for(var i=0;i<arr.length;i++)
	{
		if(arr[i].id.toString().substring(0,8)=="ckbispro"&&arr[i].checked==true)
			count++;
	}
	return count;	
}

//得到家庭数
function getPeopleNum()
{
	obj=document.getElementById("application");
	var arr=obj.getElementsByTagName("input");
	var count=0;
	for(var i=0;i<arr.length;i++)
	{
		if(arr[i].id.toString().substring(0,8)=="ckbispro")
			count++;
	}
	return count;	
}
//保障人口的总收入
function getPeopleIsproTotalIncoming()
{
	var incoming=0;
	obj=document.getElementById("application");
	var arr=obj.getElementsByTagName("input");	
	for(var i=0;i<arr.length;i++)
	{
		if(arr[i].id.toString().substring(0,8)=="ckbispro"&&arr[i].checked==true)
			{			
				var num=arr[i].parentNode.previousSibling.firstChild.value;
				if(isNumber(num))
					incoming+=parseFloat(num);
			}
	}
	return incoming;	
}






//是否数字
function isNumber(num)
{
	 if   (!isNaN(num))
        return true; 
	else		
		return false;
}


//收入合计

function Totleincome(str,str2,isProStr3)
{  
		///alert(getPeopleIsproTotalIncoming());
	 
		if   (isNaN(document.getElementById(str).value))
			return;
		if(document.getElementById(str2).value!=document.getElementById(str).value)
		{
			if(document.getElementById(str).value=="")
				document.getElementById(str).value="0";
			totleincome-=parseInt(document.getElementById(str2).value,10);
			totleincome+=parseInt(document.getElementById(str).value,10);
			document.getElementById(str2).value=document.getElementById(str).value;
		}
		else
		   return;
		
		
		//beacoder
		total=getPeopleIsproTotalIncoming()
		isproNum=getPeopleIsproNum()
		avgyear=total/isproNum		
		if(isNaN(avgyear))
			avgyear=0;
		avgmonth=(total/isproNum)/12		
		if(isNaN(avgmonth))
			avgmonth=0;
			
		//如 果保障人均年收入>11386.8，则出错
		if(avgyear>11386.8)
			{
				//alert("保障人均年收入不能大于11386.8")
				//document.getElementById(str).value="0"
//				total=getPeopleIsproTotalIncoming()
//				//重新计算
//				isproNum=getPeopleIsproNum()
//				avgyear=total/isproNum
//				if(isNaN(avgyear))
//					avgyear=0;
//				avgmonth=(total/isproNum)/12
//				if(isNaN(avgmonth))
//					avgmonth=0;
				
			}
			
		avgyear=avgyear.toFixed(2);
		avgmonth=avgmonth.toFixed(2);
		document.getElementById("txbtotleincome").value=total;
		document.getElementById("txbpeoplenumIsPro").value=isproNum;
		document.getElementById("txbpeoplenum").value=getPeopleNum();
		document.getElementById("txbavgincome").value=avgyear;
		document.getElementById("txbavgmonthincome").value=avgmonth; 
		
		//alert(document.getElementById("txbpeoplenum").value);

}

function TotleincomeAfterDel(str)
{
   // if(document.getElementById(str).value!="" && document.getElementById(str).value!="0")
//    {
//        totleincome-=parseInt(document.getElementById(str).value,10);
//        document.getElementById("txbtotleincome").value=totleincome;
//    }
//    document.getElementById("txbtotleincome").value=totleincome;
//    document.getElementById("txbpeoplenum").value=getPeopleIsproNum();
//    document.getElementById("txbavgincome").value=totleincome/peoplenum;
//    document.getElementById("txbavgmonthincome").value=document.getElementById("txbavgincome").value/12; 
	
	//beacoder
		total=getPeopleIsproTotalIncoming()
		isproNum=getPeopleIsproNum()
		avgyear=total/isproNum		
		if(isNaN(avgyear))
			avgyear=0;
		avgmonth=(total/isproNum)/12		
		if(isNaN(avgmonth))
			avgmonth=0;
			
			
		avgyear=avgyear.toFixed(2);
		avgmonth=avgmonth.toFixed(2);
		document.getElementById("txbtotleincome").value=total;
		document.getElementById("txbpeoplenumIsPro").value=isproNum;
		document.getElementById("txbpeoplenum").value=getPeopleNum();
		document.getElementById("txbavgincome").value=avgyear;
		document.getElementById("txbavgmonthincome").value=avgmonth; 
}
//财产合计
var totlemoney=0;
function TotleMoney(str,str2)
{
    if(document.getElementById(str2).value!=document.getElementById(str).value)
    {
        if(document.getElementById(str).value==""||isNaN(document.getElementById(str).value))
            document.getElementById(str).value="0";
        totlemoney-=parseInt(document.getElementById(str2).value,10);
        totlemoney+=parseInt(document.getElementById(str).value,10);
        document.getElementById(str2).value=document.getElementById(str).value;
    }
    else
       return;
    document.getElementById("txbtotleproperty").value=totlemoney;
} 


//房产面积合计
function getTotal()
{
	var totlearea=0;
	arr=new Array();
	arr[0]=document.getElementById("txbarea").value;
	for(i=1;i<20;i++)
	{
		if(document.getElementById('txbarea'+i))
		{
			arr[i]=document.getElementById('txbarea'+i).value;
		}
	}
	if(document.getElementById("ckbaddcount").checked==true)
		//totlearea+=parseInt(arr[0]);改为：
		totlearea+=Number(arr[0]);
	for(i=1;i<arr.length;i++)
	{
		if(document.getElementById("ckbaddcount"+i).checked==true)
			totlearea+=parseInt(arr[i]);	
	}
	document.getElementById("txbtotlearea").value=totlearea;
    document.getElementById("txbavgarea").value=(totlearea/peoplenum).toFixed(2);	
	
}


function AddRowApplication()
{

    rowcountApp=getPeopleNum()
	oldhtml=document.getElementById("application").innerHTML;
	oldhtml+='<table width="100%" border="1" cellspacing="0" style="border-top:none; border-bottom:none; border-left:none; border-right:none"  id="AppNode'+rowcountApp+'">';
	oldhtml+='<tr>'
    oldhtml+='<td width="56px" height="50"><input type="text" name="txbapplytitle'+rowcountApp+'" style="width:90%" class="UnderlineButton1"></td>'
    oldhtml+='<td width="58px"><input type="text" name="txbname' + rowcountApp + '" style="width:90%" class="UnderlineButton1"></td>';
    oldhtml+='<td width="59px"><select name="ddlmarry' + rowcountApp + '"><option>未婚</option><option>已婚</option><option>离婚</option><option>丧偶</option></select></td>';
	
	
    oldhtml+='<td width="212px"><input type="text" name="txbunit' + rowcountApp + '" style="width:90%" class="UnderlineButton1"></td>';
    oldhtml+='<td width="214px"><input type="text" name="txbcard' + rowcountApp + '" style="width:90%" class="UnderlineButton1"  onblur="isChinaIDCard(\'txbcard' + rowcountApp + '\');"></td>';
    
	
	oldhtml+='<td width="168px"><input type="text" id="txbincome' + rowcountApp + '" name="txbincome' + rowcountApp + '" style="width:90%" class="UnderlineButton1"  onkeyup="Totleincome(\'txbincome'+rowcountApp+'\',\'text_val'+rowcountApp+'\',\'ckbispro' + rowcountApp + '\');"      onclick="Totleincome(\'txbincome'+rowcountApp+'\',\'text_val'+rowcountApp+'\',\'ckbispro' + rowcountApp + '\');" value=0  ><input type="hidden" id="text_val'+rowcountApp+'" value="0" /></td>';
	
	
	oldhtml+='<td width="72px">&nbsp;&nbsp;<input type="checkbox" id="ckbispro' + rowcountApp + '" name="ckbispro' + rowcountApp + '" onclick="CountIsproNum(\'ckbispro' + rowcountApp + '\');"></td>';
	
	
	oldhtml+='<td width="38px"><input type="button" value="删除" name="del'+rowcountApp+'" onclick="DelRowApplication(this);getTotal();RefreshAll()"/></td></tr>';
	oldhtml+='</table>';
    document.getElementById("application").innerHTML=oldhtml;
	rowcountApp++;
	peoplenum++;
}



//添加Housing
var rowcount=1;     //行号与列号
var mmm=2;
function AddRowHousing()
{
	//alert(getHouseNum());
	rowcount=getHouseNum();
	oldhtml=document.getElementById("houses").innerHTML;
	oldhtml+='<table width="100%" border="1" cellspacing="0"  style="border-top:none; border-bottom:none; border-left:none; border-right:none" id="HousingNode'+rowcount+'">';
	oldhtml+='<tr>'
    oldhtml+='<td width="25px" style="height: 37px">'+(++rowcount)+'&nbsp;</td>'
    oldhtml+='<td style="width:175px;height:37px;"><input type="text" name="txblocal' + rowcount + '" class="UnderlineButton1"  style="width:150px"></td>'
    oldhtml+='<td style="height:37px;width:80px;"><input type="text" name="txbarea' + rowcount + '" id="txbarea' + rowcount + '" class="UnderlineButton1" style="width:45px" onblur="OnlyNumber(\'txbarea'+rowcount+'\',\'建筑面积\');getHouseTotalArea()"></td>';
	oldhtml+='<td style="height: 37px; width: 87px;"><input type="text" name="txbowner' + rowcount + '" class="UnderlineButton1" style="width:60px"></td>';
	oldhtml+='<td style="width: 129px; height: 37px;"><input type="text" name="txbownproof' + rowcount + '" class="UnderlineButton1" style="width:100px"></td>';
	oldhtml+='<td style="width: 149px; height: 37px;"><input type="text" name="txbnature' + rowcount + '" class="UnderlineButton1" style="width:100px"></td>';
	oldhtml+='<td style="width: 161px; height: 37px;"><input type="text" name="txbremark' + rowcount + '" class="UnderlineButton1" style="width:150px"></td>';
	oldhtml+='<td style="width: 78px; height: 37px;"><input type="checkbox" id="ckbaddcount' + rowcount + '" name="ckbaddcount' + rowcount + '" onclick=" getHouseTotalArea();Subsidy();"></td>';
	oldhtml+='<td style="width: 42px; height: 37px;"><input type="button" value="删除" name="del'+rowcount+'" onclick="DelRowHousing(this); getHouseTotalArea();Subsidy();"/></td>';
	oldhtml+='</tr>';
	oldhtml+='</table>';
    document.getElementById("houses").innerHTML=oldhtml;
	rowcount++;
  
}


var ispronum=1;
//统计保障人口数
function CountIsproNum(str)
{
    if(document.getElementById(str).checked==true)
        ispronum++;
    else
        ispronum--
		
		
		//beacoder
		total=getPeopleIsproTotalIncoming()
		isproNum=getPeopleIsproNum()
		avgyear=total/isproNum		
		if(isNaN(avgyear))
			avgyear=0;
		avgmonth=(total/isproNum)/12		
		if(isNaN(avgmonth))
			avgmonth=0;
		
			
		avgyear=avgyear.toFixed(2);
		avgmonth=avgmonth.toFixed(2);
		document.getElementById("txbtotleincome").value=total;
		document.getElementById("txbpeoplenumIsPro").value=isproNum;
		document.getElementById("txbpeoplenum").value=getPeopleNum();
		document.getElementById("txbavgincome").value=avgyear;
		document.getElementById("txbavgmonthincome").value=avgmonth; 

		}

var oldvalue=0;
//只能是数字验证

function DigitInput(el,ev) {
    var event = ev || window.event;                 
    var currentKey = event.charCode||event.keyCode;      
    
    //小数点处理
    if (currentKey == 110 || currentKey == 190) {
        if (el.value.indexOf(".")>=0) 
            if (window.event)                       
                event.returnValue=false;                
            else                                    
                event.preventDefault();

    } else 
        if (currentKey!=8 && currentKey != 46 && (currentKey<37 || currentKey>40) && (currentKey<48 || currentKey>57) && (currentKey<96 || currentKey>105))
            if (window.event)                       //IE
                event.returnValue=false;                
            else                                    //火狐
                event.preventDefault();

}

function OnlyNumber(str,str2)
{
    if   (!isNaN(document.getElementById(str).value))
    {   
        return true;
    }   
    else
    {   
        alert(str2+"只能为数字..."); 
        document.getElementById(str).focus();
        return　false;   
    }   
}   




//证件号处显示证件所属类型
var doctype;
function   ShowDocTpye()   
{   
    var opts = document.all("rbldoc");
    if(opts)   
    {   
        for(var i = 0; i < opts.length; i++)   
        {   
            if (opts[i].checked)   
            {      
                document.getElementById("show").innerHTML=opts[i].value;
                doctype=opts[i].value;
                break;   
            }   
        }   
     }   
}
//添加保障类型点击事件
var otherrentstandard  //租金补贴标准(最低收入、其他家庭)
var lowrentstandard      //租金补贴标准(低收入)
var onlyonearea             //租金补贴户面积（36㎡）
var homeavgarea            //租金补贴比较面积(18㎡)
var standardlowarea      //保障面积最低标准(5㎡)
var subarea
var submoney
var mess=""
function Subsidy()
{
    //
    ShowDocTpye();
    var inhtml;
    totlearea=document.getElementById("txbtotlearea").value;
    otherrentstandard=document.getElementById("otherrentstandard").value  //租金补贴标准(最低收入、其他家庭)
    lowrentstandard=document.getElementById("lowrentstandard").value      //租金补贴标准(低收入)
    onlyonearea=document.getElementById("onlyonearea").value             //租金补贴户面积（36㎡）
    homeavgarea=document.getElementById("homeavgarea").value              //租金补贴比较面积(18㎡)
    standardlowarea=document.getElementById("standardlowarea").value      //保障面积最低标准(5㎡)
    subarea=0;
    submoney=0;
	
	//beacoder 
	peoplenum=getPeopleNum();
	//alert(peoplenum)
	ispronum=getPeopleIsproNum();
    if(document.getElementById("ckbsubsidy").checked==true)
    {
        //if (peoplenum==1)
        if(getPeopleIsproNum()==1)
        {
            subarea=onlyonearea-totlearea/peoplenum;
            if (subarea>0&&subarea<5)
                subarea= 5;
            if (subarea<0)
            {
                inhtml='住房面积合计不符合廉租住房租金补贴条件';
                mess="住房面积合计不符合廉租住房租金补贴条件";                
                document.getElementById("subsidy").innerHTML=inhtml;
                return;   
            }
            inhtml='补贴建筑面积为'+onlyonearea+'-'+totlearea+'\/ '+peoplenum+'=<span style="color:red;font-size:14px">'+subarea+'</span>平方米<br/>'; 
        }
        else
        {
            subarea=ispronum*homeavgarea-((totlearea/peoplenum)*ispronum);
            if (subarea>0&&subarea<5)
                subarea=5;
            if (subarea<0)
            {
                inhtml='住房面积合计不符合廉租住房租金补贴条件';
                mess="住房面积合计不符合廉租住房租金补贴条件";
                document.getElementById("subsidy").innerHTML=inhtml;
                return;  
            }
			
            inhtml='补贴建筑面积为'+ispronum+'*'+parseFloat(homeavgarea).toFixed(2)+'-('+totlearea+'/'+peoplenum+')*'+ispronum+'=<span style="color:red;font-size:14px">'+subarea.toFixed(2).toString()+'</span>平方米<br/>'; 
        }
	
        if (doctype=="最低收入家庭"||doctype=="低保证"||doctype=="扶助证"||doctype=="特困证" )
        {
            submoney=subarea*otherrentstandard;
			submoney=submoney.toFixed(2)
			//alert(parseInt(submoney));
		    m10=parseInt(submoney*10)
		    mint10=parseInt(submoney)*10
		    if(m10>mint10)
			    {submoney++;}		
		    submoney=parseInt(submoney);
            inhtml+='月补贴金额为'+subarea.toFixed(2)+'*'+otherrentstandard+'=<span style="color:red;font-size:14px">'+submoney+'</span>元';    
        }
        else if(doctype=="低收入家庭"||doctype=="其他家庭")
        {
            submoney=subarea*lowrentstandard;
			submoney=submoney.toFixed(2)
		    m10=parseInt(submoney*10)
		    mint10=parseInt(submoney)*10
		    if(m10>mint10)
			    {submoney++;}		
		    submoney=parseInt(submoney);
            inhtml+='月补贴金额为'+subarea.toFixed(2)+'*'+lowrentstandard+'=<span style="color:red;font-size:14px">'+submoney+'</span>元';    
        }
        else
        {
            inhtml='<span style="color:red">未选择相关证件材料</span>';
            document.getElementById("subsidy").innerHTML=inhtml;
            mess="未选择相关证件材料";
            return;  
        }
	
	
        document.getElementById("submoney").value=submoney;
        document.getElementById("subarea").value=subarea;
        //inhtml='补贴建筑面积为<span style="color:red;font-size:14px">'+ispronum+'*'+subarea+'</span>平方米<br/>';
        //inhtml+='月补贴金额为<span style="color:red;font-size:14px">'+submoney+'</span>元';
        document.getElementById("subsidy").innerHTML=inhtml;
    }
    else
    {    
        document.getElementById("subsidy").innerHTML="";
        mess="";
    }
}
function Reduce()
{
    if(document.getElementById("ckbreduce").checked==true)
    {
        var inhtml='承&nbsp;&nbsp;租&nbsp;&nbsp;人&nbsp; ：<input type="text" name="username" class="UnderlineButton1"><br/>';
        inhtml+='承 租 地 址 ：<input type="text" name="address" class="UnderlineButton1"><br/>';
        inhtml+='住房计租面积：<input type="text" name="area" class="UnderlineButton1"><br/>';
        inhtml+='核定月租金&nbsp;&nbsp;：<input type="text" name="checkmoney" class="UnderlineButton1"><br/>';
        inhtml+='月减免租金额：<input type="text" name="reducemoney" class="UnderlineButton1"><br/>';
        document.getElementById("reduce").innerHTML=inhtml;
    }
    else
        document.getElementById("reduce").innerHTML="";
}
function Kind()
{
    if(document.getElementById("ckbkind").checked==true)
    {
        var inhtml='房屋座落：<input type="text" name="houseaddress" class="UnderlineButton1"><br/>';
        inhtml+='建筑面积：<input type="text" name="housearea" class="UnderlineButton1"><br/>';
        inhtml+='使用面积：<input type="text" name="usearea" class="UnderlineButton1"><br/>';
        document.getElementById("kind").innerHTML=inhtml;
    }
    else
        document.getElementById("kind").innerHTML="";
}





function  isChinaIDCard(StrNo)
{   
    StrNo   =   document.getElementById(StrNo).value;
    if(StrNo.length==18)   
    {   
        var a,b,c   
        if (!isInteger(StrNo.substr(0,17)))
            return false;  
        a=parseInt(StrNo.substr(0,1))*7+parseInt(StrNo.substr(1,1))*9+parseInt(StrNo.substr(2,1))*10;   
        a=a+parseInt(StrNo.substr(3,1))*5+parseInt(StrNo.substr(4,1))*8+parseInt(StrNo.substr(5,1))*4;   
        a=a+parseInt(StrNo.substr(6,1))*2+parseInt(StrNo.substr(7,1))*1+parseInt(StrNo.substr(8,1))*6;     
        a=a+parseInt(StrNo.substr(9,1))*3+parseInt(StrNo.substr(10,1))*7+parseInt(StrNo.substr(11,1))*9;     
        a=a+parseInt(StrNo.substr(12,1))*10+parseInt(StrNo.substr(13,1))*5+parseInt(StrNo.substr(14,1))*8;     
        a=a+parseInt(StrNo.substr(15,1))*4+parseInt(StrNo.substr(16,1))*2;   
        b=a%11;   
        if   (b==2)   //最后一位为校验位   
        {   
            c=StrNo.substr(17,1).toUpperCase();   //转为大写X   
        }   
        else   
        {   
            c=parseInt(StrNo.substr(17,1));   
        }   
        switch(b)   
        {   
            case 0: if(c!=1){alert("身份证号码校验位错:最后一位应该为:1");return false;}break;   
            case 1: if(c!=0){alert("身份证号码校验位错:最后一位应该为:0");return false;}break;   
            case 2: if(c!="X"){alert("身份证号码校验位错:最后一位应该为:X");return false;}break;   
            case 3: if(c!=9){alert("身份证号码校验位错:最后一位应该为:9");return false;}break;   
            case 4: if(c!=8){alert("身份证号码校验位错:最后一位应该为:8");return false;}break;   
            case 5: if(c!=7){alert("身份证号码校验位错:最后一位应该为:7");return false;}break;   
            case 6: if(c!=6){alert("身份证号码校验位错:最后一位应该为:6");return false;}break;   
            case 7: if(c!=5){alert("身份证号码校验位错:最后一位应该为:5");return false;}break;   
            case 8: if(c!=4){alert("身份证号码校验位错:最后一位应该为:4");return false;}break;   
            case 9: if(c!=3){alert("身份证号码校验位错:最后一位应该为:3");return false;}break;   
            case 10: if(c!=2){alert("身份证号码校验位错:最后一位应该为:2");return false}   
        }   
    }   
    else   //15位身份证号   
    {   
        if(!isInteger(StrNo))
        {
            alert("身份证号码错误,前15位不能含有英文字母！");
            return false
        }     
    }
    switch(StrNo.length)
    {   
        case 15:     
        if(isValidDate("19"+StrNo.substr(6,2),StrNo.substr(8,2),StrNo.substr(10,2)))   
            return true;  
        else   
            return false;  
        case 18:     
            if(isValidDate(StrNo.substr(6,4),StrNo.substr(10,2),StrNo.substr(12,2)))   
                return   true; 
            else   
                return   false; 
    }   
    alert("输入的身份证号码必须为15位或者18位！");   
    return false;   
}
function isValidDate(iY,   iM,   iD)   
{     
//    var a=new   Date(iY,iM,iD);   
//    var y=a.getFullYear();   
//    var m=a.getMonth();   
//    var d=a.getDate();   
//    if(y!=iY || m!=iM || d!=iD)   
//    {   
//        window.alert('身份证号码内日期错误！');   
//        return false;   
//    }   
    return true;   
}     
function isInteger(str)   
{   
    if   (/[^\d]+$/.test(str))   
        return   false;   
    return   true;   
}    
function   IDUpdate(StrNo)
{     
    if(!isChinaIDCard(StrNo))
        {return false;}   
    if(StrNo.length==15)   
    {   
        var   a,b,c   
        StrNo=StrNo.substr(0,6)+"19"+StrNo.substr(6,9)   
        a=parseInt(StrNo.substr(0,1))*7+parseInt(StrNo.substr(1,1))*9+parseInt(StrNo.substr(2,1))*10;   
        a=a+parseInt(StrNo.substr(3,1))*5+parseInt(StrNo.substr(4,1))*8+parseInt(StrNo.substr(5,1))*4;   
        a=a+parseInt(StrNo.substr(6,1))*2+parseInt(StrNo.substr(7,1))*1+parseInt(StrNo.substr(8,1))*6;     
        a=a+parseInt(StrNo.substr(9,1))*3+parseInt(StrNo.substr(10,1))*7+parseInt(StrNo.substr(11,1))*9;     
        a=a+parseInt(StrNo.substr(12,1))*10+parseInt(StrNo.substr(13,1))*5+parseInt(StrNo.substr(14,1))*8;     
        a=a+parseInt(StrNo.substr(15,1))*4+parseInt(StrNo.substr(16,1))*2;   
        b=a%11;   
        switch(b)   
        {   
            case   0:   {StrNo=StrNo+"1";}break;   
            case   1:   {StrNo=StrNo+"0";}break;   
            case   2:   {StrNo=StrNo+"X";}break;   
            case   3:   {StrNo=StrNo+"9";}break;   
            case   4:   {StrNo=StrNo+"8";}break;   
            case   5:   {StrNo=StrNo+"7";}break;   
            case   6:   {StrNo=StrNo+"6";}break;   
            case   7:   {StrNo=StrNo+"5";}break;   
            case   8:   {StrNo=StrNo+"4";}break;   
            case   9:   {StrNo=StrNo+"3";}break;   
            case   10:   {StrNo=StrNo+"3";}   
        }   
    }   
    return StrNo;   
} 